<template>
	<view class="modifyAddress">
		<view class="tips">
			<view class="tips-img">
				<image style="width: 100%;height: 100%;" src="../../../static/luckDraw/details/tips.png" mode=""></image>
			</view>
			
			<view class="tips-right">
				<text style="color: #FF7200;">
                  修改付款后会影响物流的时效，只能原价修改且兑换后只能修改一次。</text>
				<text>若因商品换仓、已发货、运费变更等原因导致的修改失败，请您谅解</text>
			</view>
		</view>
		<view class="oldAddress">
			<view class="oldAddress-title">
				原地址：
			</view>
			<view class="oldAddress-text">
				四川省 成都市 武侯区 石羊场街道 交子大道177
				号中海国际中心A栋13楼1303
			</view>
		</view>
		<view class="newAddress">
			<view class="newAddress-title">
				<text>选择新的收获地址</text>
				<text>添加新地址</text>
			</view>
			<view style="font-size: 28rpx;font-family: Source Han Sans CN;font-weight: 400;color: #999999;padding: 15rpx 0;">
				近期使用
			</view>
			<view class="address-box">
				<view class="address-box-selete" v-for="(item,index) in addressList" :key='index'>
					<view class="top">
						<text class="name">{{item.name}}</text>
						<text class="phone">{{item.phone}}</text>
					</view>
					<view class="bottom">
						<view class="bottom-left">
							{{item.address}}
						</view>
						<view class="bottom-right">
							<view class="options" :class="{'options-active':isChange == index}" @click="checked(index)"></view>
						</view>
					</view>
				</view>
			</view>
			<view class="submit" @click="submit">
				提交修改
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isChange:'-1',//单选
				addressList:[{
					name:'小明',phone:'123456789',address:'四川省成都市武侯区石羊街道交子大道177号中海国际中心A座13楼1303',isChecked:false
				},
				{
					name:'小明',phone:'123456789',address:'四川省成都市武侯区石羊街道交子大道177号中海国际中心A座13楼1303',isChecked:false
				}]
			}
		},
		methods: {
			//单选框
			checked(index){
				if(index!=this.isChange){
					this.isChange = index
				}
			},
			submit(){
				uni.navigateTo({
					url:'/myPackageA/mine/myOrder/myOrder?current=1'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.submit{
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 88rpx;
		background: #FF7200;
		opacity: 1;
		border-radius: 0px;
		color: #ffffff;
		font-size: 36rpx;
		text-align: center;
		line-height: 88rpx;
	}
	.modifyAddress{
		padding-bottom: 60rpx;
	}
	.newAddress{
		width: 100%;
		height: auto;
		background: #FFFFFF;
		opacity: 1;
		border-radius: 20rpx 20rpx 0px 0px;
		margin-top: 20rpx;
		padding: 40rpx;
		.address-box{
			padding: 40rpx;
			width: 100%;
			height: auto;
			background: #F2F2F2;
			opacity: 1;
			border-radius: 20rpx;
			.address-box-selete{
				margin-bottom: 60rpx;
				.bottom{
					display: flex;
					justify-content: space-between;
					align-items: center;
					.bottom-left{
						font-size: 32rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #333333;
					}
					.bottom-right{
						margin-left: 16rpx;
						.options{
							width: 34rpx;
							height: 34rpx;
							background: #FFFFFF;
							border: 1px solid #B7B7B7;
							border-radius: 50%;
							opacity: 1;
						}
						.options-active{
							width: 34rpx;
							height: 34rpx;
							background: #FF7200;
							border-radius: 50%;
							opacity: 1;
						}
					}
				}
				.top{
					display: flex;
					align-items: center;
					.name{
						font-size: 36rpx;
						font-family: Source Han Sans CN;
						font-weight: 500;
						color: #333333;
					}
					.phone{
						font-size: 16px;
						font-family: Source Han Sans CN;
						font-weight: 400;
						line-height: 0px;
						color: #999999;
						margin-left: 20rpx;
					}
				}
			}
		}
		.newAddress-title{
			margin-bottom: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			text:first-child{
				font-size: 36rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #333333;
			}
			text:last-child{
				font-size: 28rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #999999;
			}
		}
	}
	.oldAddress{
		padding: 40rpx;
		.oldAddress-title{
			font-size: 36rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #333333;
		}
		.oldAddress-text{
			font-size: 32rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #666666;
		}
	}
	.tips{
		width: 100%;
		height: 124rpx;
		background: #FFFFFF;
		opacity: 1;
		display: flex;
		padding: 20rpx 40rpx;
		align-items: center;
		.tips-img{
			width: 60rpx;
			height: 60rpx;
		}
		.tips-right{
			width: 90%;
			font-size: 12px;
			font-family: Source Han Sans CN;
			font-weight: 400;
			line-height: 16px;
			color: #999999;
			margin-left: 10rpx;
		}
	}
</style>
